<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{$websetup.webname}</title>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Css/index.css" />
<script type="text/javascript" src="__PUBLIC__/Js/jquery.js"></script>
<script type="text/javascript"> 
var curr_btn_id = 22;


//打印优惠券
function print_pre(id){
	if(isNaN(parseInt(id)))throw('参数错误');
	var p_num_arr=new Array();
	var p_id_arr=new Array();
	$("input[name='p_num']").each(function(i,n){
		var num=$.trim($(n).val());
		if(num!=''&&!isNaN(num)){
			 p_num_arr.push($.trim($(n).val()));
			 p_id_arr.push($(n).attr("id"));
		}
	});
	if(p_num_arr.length==0){
		alert('请输入你要打印的张数');
		return false;
	}
	var p_num_str=p_num_arr.join(",");
	var p_id_str=p_id_arr.join(",");
	
	var open_url="__URL__/print_pre/p_num_str/"+p_num_str+"/p_id_str/"+p_id_str;
	window.open(open_url,'_blank','');
}

</script>
</head>
<body>
<!-- layout::Home:Public:top::0 -->
<div class="all_div mt8">
	<div><img src="__PUBLIC__/images/home/yhj_tit.gif" width="168" height="38" border="0" alt=""></div>
	<div id="" class="">
		<div class="news_tit">优惠券专区列表</div>
		<div class="prefer_con">
			<ul class="prefer_list clearfix">
               <volist name="c_list" id="vo">
                <li>
					<div><img src="__ROOT__/{$vo.cp_small_pic}" width="285" height="166" border="0" alt=""></div>
					<div class="clearfix prefer_c1">
						<div class="fl_l w28">
							<img src="__PUBLIC__/images/home/juan.jpg" width="17" height="17" border="0" alt="">
						</div>
						<div class="fl_l">
							<div class="prefer_c2">
								人气：{$vo.rank_img}
							</div>
							<div class="">
									我要<input type="text" name="p_num" id="{$vo.id}" value="1" class="prefer_text">张<input type="button" value="下载" onclick="javascript:print_pre('{$vo.id}');" class="prefer_btn">
							</div>
						</div>
					</div>
				</li>
               </volist>
			</ul>
			<div class="pages_list" align="center">
                {$divpage}
				到第<input type="text" name="p" id="p" class="go_num">页<input type="button" value="确定" onclick="var go_url='{:U('Preference/index')}';var p=document.getElementById('p').value; if(p==''||isNaN(p)){alert('请输入数字');return false;}else{location.href=go_url+'/p/'+p;}" class="go_btn">
			</div>
		</div>
	</div>
</div>
<!-- layout::Home:Public:bottom::-1 -->
</body>
</html>